<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<span class="page">
共有${total}条记录,${indexPage}/${totalPage},每页${row}条, 
<c:if test="${indexPage!=1}">
	<a href="javascript:gotoPage(1)">首页</a>
	<a href="javascript:gotoPage(${indexPage-1});">上一页</a>
</c:if>
<c:if test="${afterPage!=0}">
	<c:forEach var="i" begin="0" end="${afterPage-1}" step="1">
		<a href="javascript:gotoPage(${indexPage-afterPage+i});">${indexPage-afterPage+i}</a>
	</c:forEach>
</c:if>
<c:forEach var="k" begin="${indexPage+1}" end="${beforePage}" step="1">
	<a  href="javascript:gotoPage(${k});">${k}</a>
</c:forEach>
<c:if test="${indexPage!=totalPage}">
	<a href="javascript:gotoPage(${indexPage+1});">下一页</a>
	<a href="javascript:gotoPage(${totalPage});">末页</a>
</c:if>
&nbsp;&nbsp;
快速跳至:<input type="text" id="goal" name="goal"  size="2"/>页
<input type="submit" id="go" name="go" value="Go" maxLength="5" size="2" class="submit" onclick=" return gotoPages();"/>
</span>

<input type="hidden" id="indexPage" name="indexPage" value="${indexPage}"/>
<script type="text/javascript">
function gotoPage(pageNum){
	var frm = document.mainForm;
	frm.indexPage.value = pageNum;
	frm.submit();
}

function gotoPages(){
    var pages = document.mainForm.goal.value;
	if(pages<0||pages=="") {
	 	pages=0;
	}
	if(isNaN(pages)){
	    alert("请输入数字!");
		return false;
	}
	pages=parseInt(pages);
	document.mainForm.indexPage.value = pages;
}
</script>